package com.mysoft.gfyx.marketdevelop.controller;

import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.marketdevelop.controller.dto.ClearCacheRequestDto;
import com.mysoft.gfyx.marketdevelop.service.DeveloperService;
import com.mysoft.gfyx.marketdevelop.service.LabelService;
import com.mysoft.gfyx.marketdevelop.service.dto.label.LabelApplicationSettingDto;
import com.mysoft.gfyx.marketdevelop.service.dto.label.LabelValueSettingDto;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

@PubService(value = "/labelDataApi", prefix = RequestPrefix.API)
@Tag(name = "标签管理-API")
public class LabelDataApiController {

    @Autowired
    private LabelService labelService;

    @PubAction(value = "/setLabelApplication", method = RequestMethod.POST)
    public Object setLabelApplication(@RequestBody LabelApplicationSettingDto dto) {
        return labelService.setLabelApplication(dto);
    }

    @PubAction(value = "/setLabelValue", method = RequestMethod.POST)
    public Object setLabelValue(@RequestBody LabelValueSettingDto dto) {
        return labelService.setLabelValue(dto);
    }

    @PubAction(value = "/getAllTagsData", method = RequestMethod.POST)
    public Object getAllTagsData() {
        return labelService.getAllTagsData(DeveloperService.TjEntity.Developer);
    }
}
